from PyQt5.Qt import *
import sys

"""
1. mouseMoveEvent  鼠标跟踪
2. mousePressEvent 鼠标按下
3. mouseReleaseEvent  鼠标松开
4. mouseDoubleClickEvent  鼠标双击
"""
class Window(QWidget):
    def __init__(self):
        super().__init__()
        self.setWindowTitle("")
        self.resize(600,400)
    def mousePressEvent(self,evt):
        print('111')
        if evt.button()==Qt.LeftButton:
            print('你按的鼠标左键')
        if evt.button()==Qt.RightButton:
            print('你按的鼠标右键')
        if evt.button()==Qt.MiddleButton:
            print('你按的鼠标滚轮')
    def mouseDoubleClickEvent(self,evt):
        print('222')
        if evt.button() == Qt.LeftButton:
            print('鼠标双击左键')
        if evt.button() == Qt.RightButton:
            print('鼠标双击右键')
        if evt.button() == Qt.MiddleButton:
            print('鼠标双击滚轮')
    def wheelEvent(self, evt):
        a=evt.angleDelta()
        # print(evt.angleDelta)
        print(a.x(),a.y())

if __name__=='__main__':
    app = QApplication(sys.argv)
    w = Window()
    w.show()
    sys.exit(app.exec_())